# Locate osgCairo
# OSGCAIRO_FOUND, if false, do not try to link to osg 
# OSGCAIRO_INCLUDE_DIR, where to find the headers
#
# OSGCAIRO_INSTALL_PREFIX installation prefix

SET(OSGCAIRO_INSTALL_PREFIX "/usr/local" CACHE PATH "osgCairo install prefix")

FIND_PATH(OSGCAIRO_INCLUDE_DIR osgCairo/Version ${OSGCAIRO_INSTALL_PREFIX}/include NO_DEFAULT_PATH)
FIND_PATH(CAIRO_INCLUDE_DIR cairo/cairo.h)

LIST(APPEND OSGCAIRO_INCLUDE_DIRS ${OSGCAIRO_INCLUDE_DIR})
LIST(APPEND OSGCAIRO_INCLUDE_DIRS ${CAIRO_INCLUDE_DIR}/cairo)

FIND_LIBRARY(osgCairo_LIBRARY_DEBUG NAMES osgCairod PATHS ${OSGCAIRO_INSTALL_PREFIX}/lib NO_DEFAULT_PATH)
FIND_LIBRARY(osgCairo_LIBRARY NAMES osgCairo PATHS ${OSGCAIRO_INSTALL_PREFIX}/lib NO_DEFAULT_PATH)
FIND_LIBRARY(cairo_LIBRARY NAMES cairo)

IF(NOT osgCairo_LIBRARY_DEBUG)
	IF(osgCairo_LIBRARY)
		SET(osgCairo_LIBRARY_DEBUG ${osgCairo_LIBRARY})
	ENDIF()
ENDIF()

SET(OSGCAIRO_FOUND "NO")
IF(osgCairo_LIBRARY AND OSGCAIRO_INCLUDE_DIR)
	SET(OSGCAIRO_FOUND "YES")
ENDIF(osgCairo_LIBRARY AND OSGCAIRO_INCLUDE_DIR)

